<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Module {
	
	var $active_module;
	var $CI;
	
	function __construct() {
		$this->CI =& get_instance();
		
		if (!is_null($this->active_module)) {

			if (defined("_CONTROLPANEL")) {
				$this->do_admin_preload();
			}

			if (defined("_FRONTEND")) {
				$this->do_front_preload();
			}
		}
	}

	function do_admin_preload () {
	
		if (method_exists($this, 'admin_preload')) {
			$this->admin_preload();
		}
	}

	function do_front_preload () {
	
		if (method_exists($this, 'front_preload')) {
			$this->front_preload();
		}
	}
}
